 @extends('master')

@section('title')
Scool|Record
@endsection

@section('content')
 <!-- right-top -->
    <div class="right-info" id="scrol3">
      <div class="right-info-wrapper" id="right-info-wrapper">
        <div class="height_16"></div>
        <!-- height_16 -->
        
        <div class="height_22"></div>
        <!-- height_22 -->
        <div class="table-list-info" id="zohoid-info">
          <div class="panel panel-default">
            <div class="panel-heading"> 新建 Event </div>
            <!-- panel-heading -->
            <div class="panel-body panel-body-pad">
              <form id='from'>
              <input type="hidden" name="cover_path" id="cover_path" value="" />
                <div class="form-group">
                  <label for="name_en" class="snow">Title:</label>
                  <input type="text" class="form-control form-control-inline" id="title" name="title" placeholder="标题">
                </div>
              <div class="form-group">
                  <label class="control-label">Cover</label>
                  <input id="input-4" name="pics[]" type="file" multiple class="file-loading">
              </div>
                <div class="form-group">
                  <label for="country_en" class="snow">Description:</label><br />
                  <textarea rows="10" cols="80" id="description" name="description"></textarea>
                </div>
                 <div class="form-group">
                  <label for="country_cn" class="snow">Start time:</label>
                 <input type="text" class="form-control form-control-inline" id="create_time" name="create_time" placeholder="开始时间" readonly="true">
                </div>
                 <div class="form-group">
                  <label for="location" class="label-margin">End time:</label>
                 <input type="text" class="form-control form-control-inline" id="end_time" name="end_time" placeholder="结束时间" readonly="true">
                </div>
                <div class="form-group">
                  <label for="address" class="label-margin">Address:</label>
                 <input type="text" class="form-control form-control-inline" id="address" name="address" placeholder="详细地址">
                </div>
                <div class="form-group">
                  <label for="country_cn" class="snow">Public</label>
                 <select class="form-control form-control-inline" name="is_public" id="is_public">
                 <option value="1">公开活动</option>
                 {{--<option value="0">私密活动</option>--}}
                 </select>
                </div>
                <!-- <div class="form-group">
                <label for="country_cn" class="snow">Invite</label>
                <div style="margin-bottom: 5px;width:90%;clear:both;height: 150px;overflow: scroll;">
                <div style="float: left;width:250px;height: 30px;">
                    <input type="checkbox" id="join" name="join[]" value="" />
                </div>
                </div>-->
                <div class="form-group">
                  <label for="country_cn" class="snow">Free</label>
                 <select class="form-control form-control-inline" name="is_free" id="is_free" onchange="changeTicket();">
                 {{--<option value="1">免费</option>--}}
                 <option value="0">收费</option>
                 </select>
                </div>
                <div class="form-group" id="ticket">
                <div style="float: left;width:20%;">
                    早鸟会员价<input type="text" class="form-control form-control-inline" id="ticket_title" name="ticket_eb[name]" placeholder="标题"><br />
                     Ticket currency<select class="form-control form-control-inline" id="ticket_currency" name="ticket_eb[currency]">
                     <option value="USD">USD</option>
                     <option value="GBP">GBP</option>
                     <option value="CNY">CNY</option>
                     </select><br />
                     Ticket price<input type="text" class="form-control form-control-inline" id="ticket_price" name="ticket_eb[price]" placeholder="价格" /><br />
                     Ticket count<input type="text" class="form-control form-control-inline" id="ticket_count" name="ticket_eb[count]" placeholder="数量" /><br />
                     早鸟截止时间<input type="text" class="form-control form-control-inline" id="early_bird_deadline" name="ticket_eb[early_bird_deadline]" placeholder="截止时间" readonly="true">
                </div>
                <div style="float: left;width:20%;margin-left: 10px;">
                    早鸟非会员价<input type="text" class="form-control form-control-inline" id="ticket_title" name="ticket_eb_f[name]" placeholder="标题"><br />
                     Ticket currency<select class="form-control form-control-inline" id="ticket_currency" name="ticket_eb_f[currency]">
                     <option value="USD">USD</option>
                     <option value="GBP">GBP</option>
                     <option value="CNY">CNY</option>
                     </select><br />
                     Ticket price<input type="text" class="form-control form-control-inline" id="ticket_price" name="ticket_eb_f[price]" placeholder="价格" /><br />
                     Ticket count<input type="text" class="form-control form-control-inline" id="ticket_count" name="ticket_eb_f[count]" placeholder="数量" />
                </div>
                <div style="float: left;width:20%;margin-left: 10px;">
                    会员价<input type="text" class="form-control form-control-inline" id="ticket_title" name="ticket_mb[name]" placeholder="标题"><br />
                     Ticket currency<select class="form-control form-control-inline" id="ticket_currency" name="ticket_mb[currency]">
                     <option value="USD">USD</option>
                     <option value="GBP">GBP</option>
                     <option value="CNY">CNY</option>
                     </select><br />
                     Ticket price<input type="text" class="form-control form-control-inline" id="ticket_price" name="ticket_mb[price]" placeholder="价格" /><br />
                     Ticket count<input type="text" class="form-control form-control-inline" id="ticket_count" name="ticket_mb[count]" placeholder="数量" />
                </div>
                <div style="float: left;width:20%;margin-left: 10px;">
                    非会员价<input type="text" class="form-control form-control-inline" id="ticket_title" name="ticket_mb_f[name]" placeholder="标题"><br />
                     Ticket currency<select class="form-control form-control-inline" id="ticket_currency" name="ticket_mb_f[currency]">
                     <option value="USD">USD</option>
                     <option value="GBP">GBP</option>
                     <option value="CNY">CNY</option>
                     </select><br />
                     Ticket price<input type="text" class="form-control form-control-inline" id="ticket_price" name="ticket_mb_f[price]" placeholder="价格" /><br />
                     Ticket count<input type="text" class="form-control form-control-inline" id="ticket_count" name="ticket_mb_f[count]" placeholder="数量" />
                </div>

                </div>

              </form>
            </div>
            <!-- panel-body -->
            <ul class="list-group">
              <li class="list-group-item">
                <button type="submit" class="btn btn-default btn-pad" id="submit"> OK </button>
              </li>
            </ul>
          </div>
          <!-- panel --> 
        </div>
        <!-- table-list-info --> 
        
      </div>
      <!-- right-info-wrapper --> 
    </div>
    <!-- right-info --> 


    @endsection

@section('js')
<script type="text/javascript"  src="/js/event/create.js"></script>
<script>
    $('#create_time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii'
    });
    $('#end_time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii'
    });
    $('#early_bird_deadline').datetimepicker({
        format: 'yyyy-mm-dd hh:ii'
    });
    $(document).on('ready', function() {
        $("#input-4").fileinput({
        uploadUrl:'/event/uploadfile',   //上传地址
        allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'],   //接收的文件后缀
        showUpload: false,  //是否显示上传按钮
        maxFileCount:1,     //最多上传图片数量
        showCaption: false
        });
    });
    $("#input-4").on("fileuploaded", function(event, data, previewId, index) {
        if(1 == data.response.status){
            $('#cover_path').val(data.response.msg);
//            alert(data.response.msg);
        }
    });
    function changeTicket()
    {
        if(0 == $("#is_free").val()){
            $("#ticket").show();
        }else{
            $("#ticket").hide();
        }
    }
</script>
@endsection